From 1a3e530cb8d03032128c2191d6f54cd28212eee1 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Fri, 29 Jun 2007 21:00:40 +0000 Subject: [PATCH] unicsv: Quote coordinates using grid with seconds. Move function 'strenquote' to common utils. --- gpsbabel/unicsv.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/gpsbabel/unicsv.c b/gpsbabel/unicsv.c index 2192bd2ce..b04e8ce2d 100644 --- a/gpsbabel/unicsv.c +++ b/gpsbabel/unicsv.c @@ -713,33 +713,6 @@ unicsv_rd(void) /* =========================================================================== */ -static char * -strenquote(const char *str, const char quot_char) -{ - int len; - char *cin, *cout; - char *tmp; - - if (str == NULL) cin = ""; - else cin = (char *)str; - - len = strlen(cin); - cout = tmp = xmalloc((len * 2) + 3); - - *cout++ = quot_char; - while (*cin) { - *cout++ = *cin; - if (*cin++ == quot_char) - *cout++ = quot_char; - } - *cout++ = quot_char; - *cout = '\0'; - - cout = xstrdup(tmp); - xfree(tmp); - return cout; -} - static void unicsv_print_str(const char *str) { @@ -829,7 +802,7 @@ unicsv_waypt_disp_cb(const waypoint *wpt) case grid_lat_lon_dms: cout = pretty_deg_format(lat, lon, 's', unicsv_fieldsep, 0); - gbfputs(cout, fout); + gbfprintf(fout, "%c%s%c", UNICSV_QUOT_CHAR, cout, UNICSV_QUOT_CHAR); xfree(cout); break; -- 2.30.2